<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
        <script>
        // var message;
        //    var obj = {
        //         name:'张三',
        //         age: 21,
        //         getAge:function(){ 
        //             while(message != '张三'){
        //                  message = prompt('请输入名字')
        //                 message === '张三'?alert(this.age):alert("输入错误请重新输入");
        //             } 
        //         }
        //    }
        //    obj.getAge()
            function GetMessage(name){
                this.name = name;
                this.getmessage = function(){
                    console.log('asdfsadf')
                }
            }
            function Message(name) {
                this.name = name;
                this.fu = function(){
                    console.log(this)
                }
            }
           Message.prototype = new GetMessage();
           var p = new Message('zhangsan');
           p.fu();
           p.f = function(){
               console.log(aaa)
           }
        </script>
</body>
</html>